package com.xiweicheng.test.springboot.im.admin.entity.security;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "persistent_logins")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PersistentLogin implements Serializable {

    private static final long serialVersionUID = -4758666648811511623L;

    @Id
    @Column(name = "series", unique = true, nullable = false, length = 64)
	private String series;
	
    @Column(name = "username", nullable = false, length = 64)
	private String username;
	
    @Column(name = "token", nullable = false, length = 64)
	private String token;
	
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_used", nullable = false, length = 19)
	private Date lastUsed;

}
